<template>
  <div>
    <van-row>
        <van-col span="4"><left/></van-col>
        <van-col span="20">
                <van-row>
                    <van-col span="24">
                        <headers/>
                    </van-col>
                </van-row>
                <!-- <van-row>
                    
                </van-row> -->
                <div align='left'>
                    组织名称：<input type="text">  <van-button>查询</van-button> <van-button>重置</van-button> 
                    <br>
                    <br>
                    <van-button icon="blue" type="primary">+ 按钮</van-button> <van-button>导出</van-button>  <van-uploader :after-read="uploader">
  <van-uploader>
    <van-button icon="plus" type="primary">导入文件</van-button>
  </van-uploader>
</van-uploader>
                    <br>
                    <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" />
                </div>
        </van-col>
    </van-row>
  </div>
</template>

<script>
import headers from './comm/headers.vue'
import left from './comm/left.vue'
import axios from 'axios'
export default {
    components:{
        'headers':headers,
        'left':left,
    },
    data(){
        return{
            data: [
        {
          label: 'Level one 1',
          children: [
            {
              label: 'Level two 1-1',
              children: [
                {
                  label: 'Level three 1-1-1',
                },
              ],
            },
          ],
        },
        {
          label: 'Level one 2',
          children: [
            {
              label: 'Level two 2-1',
              children: [
                {
                  label: 'Level three 2-1-1',
                },
              ],
            },
            {
              label: 'Level two 2-2',
              children: [
                {
                  label: 'Level three 2-2-1',
                },
              ],
            },
          ],
        },
        {
          label: 'Level one 3',
          children: [
            {
              label: 'Level two 3-1',
              children: [
                {
                  label: 'Level three 3-1-1',
                },
              ],
            },
            {
              label: 'Level two 3-2',
              children: [
                {
                  label: 'Level three 3-2-1',
                },
              ],
            },
          ],
        },
      ],
      defaultProps: {
        children: 'children',
        label: 'label',
      },
    }
  },
  methods: {
    handleNodeClick(data) {
      console.log(data)
    },
    uploader(file) {
        let formData = new FormData()
        formData.append('file', file.file)
        axios({url: 'http://127.0.0.1:5000/upload', method: 'post', data: formData}).then(res => {
        console.log(res)
        })
    }
},
  
    

}
</script>

<style>

</style>